3.1 \(\int \frac {a+b \log (c x^n)}{d+e x+f x^2} \, dx\)

Optimal. Leaf size=173 \[ \frac {\log \left (\frac {2 f x}{e-\sqrt {e^2-4 d f}}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}}-\frac {\log \left (\frac {2 f x}{\sqrt {e^2-4 d f}+e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}}+\frac {b n \text {Li}_2\left (-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}} \]

[Out]

(a+b*ln(c*x^n))*ln(1+2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-(a+b*ln(c*x^n))*ln(1+2*f*x/(e+(-4*d*f+e^
2)^(1/2)))/(-4*d*f+e^2)^(1/2)+b*n*polylog(2,-2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-b*n*polylog(2,-2
*f*x/(e+(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.18, antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2357, 2317, 2391} \[ \frac {b n \text {PolyLog}\left (2,-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {PolyLog}\left (2,-\frac {2 f x}{\sqrt {e^2-4 d f}+e}\right )}{\sqrt {e^2-4 d f}}+\frac {\log \left (\frac {2 f x}{e-\sqrt {e^2-4 d f}}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}}-\frac {\log \left (\frac {2 f x}{\sqrt {e^2-4 d f}+e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] - ((a + b*Log[c*x^n])*Log[1 +
(2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] + (b*n*PolyLog[2, (-2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[
e^2 - 4*d*f] - (b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

Rule 2317

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(Log[1 + (e*x)/d]*(a +
b*Log[c*x^n])^p)/e, x] - Dist[(b*n*p)/e, Int[(Log[1 + (e*x)/d]*(a + b*Log[c*x^n])^(p - 1))/x, x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2357

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin {align*} \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (e-\sqrt {e^2-4 d f}+2 f x\right )}-\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (e+\sqrt {e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac {(2 f) \int \frac {a+b \log \left (c x^n\right )}{e-\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}-\frac {(2 f) \int \frac {a+b \log \left (c x^n\right )}{e+\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {(b n) \int \frac {\log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{x} \, dx}{\sqrt {e^2-4 d f}}+\frac {(b n) \int \frac {\log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}+\frac {b n \text {Li}_2\left (-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.17, size = 157, normalized size = 0.91 \[ \frac {\left (\log \left (\frac {-\sqrt {e^2-4 d f}+e+2 f x}{e-\sqrt {e^2-4 d f}}\right )-\log \left (\frac {\sqrt {e^2-4 d f}+e+2 f x}{\sqrt {e^2-4 d f}+e}\right )\right ) \left (a+b \log \left (c x^n\right )\right )+b n \text {Li}_2\left (\frac {2 f x}{\sqrt {e^2-4 d f}-e}\right )-b n \text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

((a + b*Log[c*x^n])*(Log[(e - Sqrt[e^2 - 4*d*f] + 2*f*x)/(e - Sqrt[e^2 - 4*d*f])] - Log[(e + Sqrt[e^2 - 4*d*f]
 + 2*f*x)/(e + Sqrt[e^2 - 4*d*f])]) + b*n*PolyLog[2, (2*f*x)/(-e + Sqrt[e^2 - 4*d*f])] - b*n*PolyLog[2, (-2*f*
x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

________________________________________________________________________________________

fricas [F]  time = 0.66, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {b \log \left (c x^{n}\right ) + a}{f x^{2} + e x + d}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {b \log \left (c x^{n}\right ) + a}{f x^{2} + e x + d}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

maple [C]  time = 0.22, size = 555, normalized size = 3.21 \[ -\frac {i \pi b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )}{\sqrt {4 d f -e^{2}}}+\frac {i \pi b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{\sqrt {4 d f -e^{2}}}+\frac {i \pi b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{\sqrt {4 d f -e^{2}}}-\frac {i \pi b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{3}}{\sqrt {4 d f -e^{2}}}-\frac {2 b n \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \ln \relax (x )}{\sqrt {4 d f -e^{2}}}+\frac {b n \ln \relax (x ) \ln \left (\frac {-2 f x -e +\sqrt {-4 d f +e^{2}}}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \ln \relax (x ) \ln \left (\frac {2 f x +e +\sqrt {-4 d f +e^{2}}}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}+\frac {b n \dilog \left (\frac {-2 f x -e +\sqrt {-4 d f +e^{2}}}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \dilog \left (\frac {2 f x +e +\sqrt {-4 d f +e^{2}}}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}+\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \ln \relax (c )}{\sqrt {4 d f -e^{2}}}+\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \ln \left (x^{n}\right )}{\sqrt {4 d f -e^{2}}}+\frac {2 a \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right )}{\sqrt {4 d f -e^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*ln(c*x^n)+a)/(f*x^2+e*x+d),x)

[Out]

-2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*n*ln(x)+2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d
*f-e^2)^(1/2))*ln(x^n)+b*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(-4*d*f+e^2)^(1/2)))-
b*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((2*f*x+(-4*d*f+e^2)^(1/2)+e)/(e+(-4*d*f+e^2)^(1/2)))+b*n/(-4*d*f+e^2)^(1/2)*di
log((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(-4*d*f+e^2)^(1/2)))-b*n/(-4*d*f+e^2)^(1/2)*dilog((2*f*x+(-4*d*f+e^2)^(1
/2)+e)/(e+(-4*d*f+e^2)^(1/2)))+I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*x^n)*csgn(I
*c*x^n)^2-I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I/(
4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c*x^n)^3+I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)
/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c*x^n)^2*csgn(I*c)+2/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*l
n(c)+2*a/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-e^2>0)', see `assume?` f
or more details)Is 4*d*f-e^2 positive or negative?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {a+b\,\ln \left (c\,x^n\right )}{f\,x^2+e\,x+d} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*x^n))/(d + e*x + f*x^2),x)

[Out]

int((a + b*log(c*x^n))/(d + e*x + f*x^2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + b \log {\left (c x^{n} \right )}}{d + e x + f x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))/(f*x**2+e*x+d),x)

[Out]

Integral((a + b*log(c*x**n))/(d + e*x + f*x**2), x)

________________________________________________________________________________________